<table>
	<tr>
		<td>
			<a class="button" href="<?php echo $this->baseUrl() ?>/cpnews/list/type/<?php echo $this->type ?>">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/left_16.png);" class="inb">Wróć do listy</div>
			</a>
		</td>
		<td>
			<a class="button" href="javascript:void(null)" onclick="$('#formitem').submit()">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/save_16.png);" class="inb">Zapisz</div>
			</a>
		</td>
	</tr>
</table>



<form id="formitem" action="<?php echo $this->baseUrl() ?>/cpnews/item/type/<?php echo $this->type ?><?php echo isSet( $this->news_id ) ? '/id/' . $this->news_id : '' ?>" method="post">
<input type="hidden" name="species" value="<?php echo $this->type ?>" />
<table cellspacing="0" cellpadding="6" class="tform">
	<tr>
		<td class="lb">Tytuł:</td>
		<td class="inpy">
			<?php if( isSet( $this->err_title_pl ) ) { ?>
				<input style="border:1px solid red;" type="text" name="title_pl" value="" />
				<div class="formerror"><?php echo $this->err_title_pl ?></div>
			<?php } else { ?>
				<input type="text" name="title_pl" value="<?php echo $this->title_pl ?>" />
			<?php } ?>
		</td>
	</tr>
	<tr>
		<td class="lb">Tytuł EN:</td>
		<td class="inpy"><input type="text" name="title_en" value="<?php echo $this->title_en ?>" /></td>
	</tr>
	<tr>
		<td class="lb">Tytuł CS:</td>
		<td class="inpy"><input type="text" name="title_cs" value="<?php echo $this->title_cs ?>" /></td>
	</tr>
	<tr>
		<td class="lb">Tekst PL:</td>
		<td class="inpy"><textarea style="height: 90px;" id="lead_pl" name="lead_pl"><?php echo $this->lead_pl ?></textarea></td>
	
		 <?php 
		$this->headScript()->appendFile($this->baseUrl().'/public/js/ckeditor.js' ); 
		$this->headScript()->appendFile($this->baseUrl().'/public/js/ckfinder/ckfinder.js' );
		echo $this->inlineScript()->setScript(' 

		var edytor1 = CKEDITOR.replace( "lead_pl", {
				toolbar : [ [ "Source", "-", "Bold", "Italic", "Underline", "Strike","TextColor","-","Link","Image","Flash","Table","HorizontalRule","Smiley","SpecialChar","PageBreak" ] ]
			}
		); 
		CKFinder.setupCKEditor( edytor1, "'.$this->baseUrl().'/public/js/ckfinder" ) ;
		');
		?>
	</tr>
	<tr>
		<td class="lb">Tekst EN:</td>
		<td class="inpy"><textarea style="height: 90px;" id="lead_en" name="lead_en"><?php echo $this->lead_en ?></textarea></td>
	
		 <?php 
		$this->headScript()->appendFile($this->baseUrl().'/public/js/ckeditor.js' ); 
		$this->headScript()->appendFile($this->baseUrl().'/public/js/ckfinder/ckfinder.js' );
		echo $this->inlineScript()->setScript(' 

		var edytor2 = CKEDITOR.replace( "lead_en", {
				toolbar : [ [ "Source", "-", "Bold", "Italic", "Underline", "Strike","TextColor","-","Link","Image","Flash","Table","HorizontalRule","Smiley","SpecialChar","PageBreak" ] ]
			}
		); 
		CKFinder.setupCKEditor( edytor2, "'.$this->baseUrl().'/public/js/ckfinder" ) ;
		');
		?>
	</tr>
	<tr>
		<td class="lb">Tekst CS:</td>
		<td class="inpy"><textarea style="height: 90px;" id="lead_cs" name="lead_cs"><?php echo $this->lead_cs ?></textarea></td>
	
		 <?php 
		$this->headScript()->appendFile($this->baseUrl().'/public/js/ckeditor.js' ); 
		$this->headScript()->appendFile($this->baseUrl().'/public/js/ckfinder/ckfinder.js' );
		echo $this->inlineScript()->setScript(' 

		var edytor3 = CKEDITOR.replace( "lead_cs", {
				toolbar : [ [ "Source", "-", "Bold", "Italic", "Underline", "Strike","TextColor","-","Link","Image","Flash","Table","HorizontalRule","Smiley","SpecialChar","PageBreak" ] ]
			}
		); 
		CKFinder.setupCKEditor( edytor3, "'.$this->baseUrl().'/public/js/ckfinder" ) ;
		');
		?>
	</tr>
	<tr>
		<td class="lb">Tekst jako główny:</td>
		<td class="inpy">
			<label><input <?php echo ( $this->main_page == 'yes' ) ? 'checked="checked"' : ''; ?> type="radio" name="main_page" value="yes" /> Tak</label>
			<label><input <?php echo ( $this->main_page == 'no' ) ? 'checked="checked"' : ''; ?> type="radio" name="main_page" value="no" /> Nie</label>
		</td>
	</tr>
	<tr>
		<td class="lb">Wybór grafiki:</td>
		<td class="inpy">
			<label><input <?php echo ( $this->graph == 1 ) ? 'checked="checked"' : 'checked="checked"'; ?> type="radio" name="graph" value="1" /> Zdjęcie</label>
			<label><input <?php echo ( $this->graph == 2 ) ? 'checked="checked"' : ''; ?> type="radio" name="graph" value="2" /> Miotacz</label>
		</td>
	</tr>
	<tr>
		<td class="lb">Formularz widoczny:</td>
		<td class="inpy">
			<label><input <?php echo ( $this->main_page2 == 'yes' ) ? 'checked="checked"' : ''; ?> type="radio" name="main_page2" value="yes" /> Tak</label>
			<label><input <?php echo ( $this->main_page2 == 'no' ) ? 'checked="checked"' : ''; ?> type="radio" name="main_page2" value="no" /> Nie</label>
		</td>
	</tr>
	<tr>
		<td class="lb">Galeria:</td>
		<td class="inpy">
			<select name="galeries_g_id">
			<?php foreach( $this->galleriesList as $value ) { ?>
				<option <?php echo ( $this->galeries_g_id == $value['g_id'] ) ? 'selected="selected"' : ''; ?> value="<?php echo $value->g_id ?>"><?php echo $value->name ?></option>
			<?php } ?>
			</select>
		</td>
	</tr>
	<tr>
		<td class="lb">Kategorie:</td>
		<td class="inpy"><?php echo $this->Categories( $this->categoriesList, $this->categories ) ?></td>
	</tr>
</table>
</form>

<table>
	<tr>
		<td>
			<a class="button" href="<?php echo $this->baseUrl() ?>/cpnews/list/type/<?php echo $this->type ?>">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/left_16.png);" class="inb">Wróć do listy</div>
			</a>
		</td>
		<td>
			<a class="button" href="javascript:void(null)" onclick="$('#formitem').submit()">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/save_16.png);" class="inb">Zapisz</div>
			</a>
		</td>
	</tr>
</table>